package tech.tongyu.bob.demo.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private int code;
    private String msg;
    private Object data;


    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(Object data) {
        this.data = data;
    }

    public static Result success(){
        return new Result(200,"success",null);
    }

    public static Result success(Object data){
        return new Result(200,"success",data);
    }

}
